add new signature p7b

Signed-off-by: jiangtao92 <jiangtao57@huawei.com>
This commit is contained in:
jiangtao92
2022-05-06 19:48:05 +08:00
parent c7e912972e
commit 3bada715dd
19 changed files with 205 additions and 173 deletions
+1 -3
View File
@@ -41,9 +41,7 @@ FilePicker应用是OpenHarmony中预置的系统应用,为用户提供文件
```
## 签名
1. 针对product下的每一个模块,配置build.gradle中的signingConfig。
2. 将signature目录下的sign_files.rar解压后放在build.gradle目录中配置的相应路径即可完成默认签名配置。
3. 把signature目录下的sig_hap.rar解压到任意目录。
1. [IDE签名配置](doc/signature.md)
## 编译运行
1. 签名配置完成后通过IDE Build -> Make All Modules即可编译出每个模块对应的hap包。
Binary file not shown.

After

Width:  |  Height:  |  Size: 89 KiB

+15
View File
@@ -0,0 +1,15 @@
# FilePicker Release 版本签名
1. 下载秘钥库:https://gitee.com/openharmony/signcenter_tool
2. 修改 `certificates/OpenHarmonyApplication.pem` -> `certificates/OpenHarmonyApplication.cer`
3. 在ide上配置本地签名:
* `p12`: `signcenter_tool/key/OpenHarmony.p12`
* `Store Password`: `123456`
* `Key Alias`: `OpenHarmony Application Release`
* `Key Password`: `123456`
* `p7b`: `signature/filepicker.p7b`
* `cer`: `signcenter_tool/certificates/OpenHarmonyApplication.cer`
![IDE签名配置](images/signature_ide_config.png)
+15 -15
View File
@@ -1,18 +1,18 @@
{
"license": "ISC",
"devDependencies": {},
"name": "filepicker",
"ohos": {
"org": "huawei",
"directoryLevel": "project",
"buildTool": "hvigor"
"license":"ISC",
"devDependencies":{},
"name":"filepicker",
"ohos":{
"org":"huawei",
"directoryLevel":"project",
"buildTool":"hvigor"
},
"description": "example description",
"repository": {},
"version": "1.0.0",
"dependencies": {
"@ohos/hvigor-ohos-plugin": "1.0.6",
"hypium": "^1.0.0",
"@ohos/hvigor": "1.0.6"
"description":"example description",
"repository":{},
"version":"1.0.0",
"dependencies":{
"@ohos/hvigor-ohos-plugin":"1.0.6",
"hypium":"^1.0.0",
"@ohos/hvigor":"1.0.6"
}
}
}
@@ -35,6 +35,9 @@ export default class MainAbility extends Ability {
windowStage.getMainWindow().then(win => {
console.log("filePicker_MainAbility: windowStage.getMainWindow()")
win.setWindowMode(102, (err, data) => {
})
win.resetSize(vp2px(752), vp2px(446))
let positionX: number = (displayWidth - vp2px(752)) / 2
@@ -52,7 +55,7 @@ export default class MainAbility extends Ability {
"ohos.permission.WRITE_MEDIA"
]
globalThis.context.requestPermissionsFromUser(permissionList)
.then(function(data) {
.then(function (data) {
console.log('filePicker_MainAbility: request permission data result = ' + data.authResults)
}, (error) => {
console.log('filePicker_MainAbility: fail to request permission error code = ' + error.code)
@@ -115,7 +115,7 @@ struct GridItemView {
alignItems: ItemAlign.Center,
justifyContent: FlexAlign.Center
}) {
Image($r("app.media.old_icon"))
Image(`${this.gridItem.path}/thumbnail/${pad_size.EIGHTY_TWO}/${pad_size.EIGHTY_TWO}`)
.objectFit(ImageFit.Contain)
.width(pad_size.EIGHTY_TWO)
.height(pad_size.EIGHTY_TWO)
@@ -1,9 +1,12 @@
import Ability from '@ohos.application.Ability'
import display from '@ohos.display'
import { LogInfo, LogDebug } from '../module/LogUtils'
let displayWidth: number = 0
let displayHeight: number = 0
const TAG = "MainAbility"
export default class MainAbility extends Ability {
onCreate(want, launchParam) {
console.log("filePicker_MainAbility: onCreate")
@@ -23,7 +26,11 @@ export default class MainAbility extends Ability {
onWindowStageCreate(windowStage) {
// Main window is created, set main page for this ability
console.log("[Demo] MainAbility onWindowStageCreate")
LogInfo(TAG, "[Demo] MainAbility onWindowStageCreate")
globalThis.context = this.context
this.requestPermissions()
display.getDefaultDisplay().then(dis => {
displayWidth = dis.width
@@ -34,20 +41,36 @@ export default class MainAbility extends Ability {
globalThis.mainDialogWidth = dis.width
globalThis.mainDialogHeight = dis.height * 0.65
console.log("cjl displayWidth = " + displayWidth + " displayHeight = " + displayHeight)
})
LogInfo(TAG, "cjl displayWidth = " + displayWidth + " displayHeight = " + displayHeight)
globalThis.context = this.context
windowStage.setUIContent(this.context, "pages/index", null)
windowStage.getMainWindow().then(win => {
LogInfo(TAG, "cjl windowStage.getMainWindow()")
windowStage.getMainWindow().then(win => {
console.log("cjl windowStage.getMainWindow()")
win.resetSize(displayWidth, (displayHeight * 0.65))
win.setBackgroundColor('#000000', (err, data) => {
if (err.code) {
LogInfo(TAG, 'Failed to set the background color. Data: ' + JSON.stringify(data))
} else {
LogInfo(TAG, 'Succeeded in setting the background color. Data: ' + JSON.stringify(data))
}
})
win.moveTo(0, (displayHeight * 0.23))
win.disableWindowDecor((err, data) => {
if (err.code) {
LogInfo(TAG, 'Failed to set the disableWindowDecor. Data: ' + JSON.stringify(data))
} else {
LogInfo(TAG, 'Succeeded in setting the disableWindowDecor. Data: ' + JSON.stringify(data))
}
})
win.on('windowSizeChange', () => {
win.resetSize(displayWidth, (displayHeight * 0.65))
win.setWindowMode(2, (err, data) => {
if (err.code) {
LogInfo(TAG, 'Failed to set the setWindowMode. Data: ' + JSON.stringify(data))
} else {
LogInfo(TAG, 'Succeeded in setting the setWindowMode. Data: ' + JSON.stringify(data))
}
})
windowStage.setUIContent(this.context, "pages/index", null)
})
})
}
@@ -66,4 +89,18 @@ export default class MainAbility extends Ability {
// Ability has back to background
console.log("[Demo] MainAbility onBackground")
}
private requestPermissions() {
let permissionList: Array<string> = [
"ohos.permission.MEDIA_LOCATION",
"ohos.permission.READ_MEDIA",
"ohos.permission.WRITE_MEDIA"
]
globalThis.context.requestPermissionsFromUser(permissionList)
.then(function (data) {
LogInfo(TAG, 'filePicker_MainAbility: request permission data result = ' + data.authResults)
}, (error) => {
LogInfo(TAG, 'filePicker_MainAbility: fail to request permission error code = ' + error.code)
})
}
};
@@ -97,7 +97,7 @@ struct GridItemView {
alignItems: ItemAlign.Center,
justifyContent: FlexAlign.Center
}) {
Image($r("app.media.icon"))
Image(`${this.gridItem.path}/thumbnail/160/160`)
.objectFit(ImageFit.Contain)
.width(80 * 2)
.height(80 * 2)
+93 -98
View File
@@ -24,7 +24,6 @@ import { LogInfo, LogDebug } from '../module/LogUtils'
import { changeStringToType, updateTopPathInfo } from '../module/Utils'
import { terminateSelfWithResult } from '../module/AbilityUtils'
import { WarningDialog } from '../module/DialogUtils'
import { getFirstMenu } from '../module/FileManagerServiceUtils'
@Entry
@@ -33,9 +32,8 @@ struct Index {
private TAG: string= 'Main'
private mWorker
private customDialogController: CustomDialogController = new CustomDialogController({
builder: WarningDialog({code: $code})
builder: WarningDialog({ code: $code })
})
@State mFirstMenuData: FileInfo[] = []
@State mSecondMenuData: FileInfo[] = []
@State mThirdMenuPicData: FileInfo[]= []
@@ -44,11 +42,9 @@ struct Index {
@State mMenuLevel: number = menuLevel.MENU_FIRST_LEVEL_BY_TYPE
@State mCurrentPath: string= ''
@State code: number = 2;
@StorageLink('startMode') mCurrentMode: string = 'choose'
@StorageLink('topPathInfo') topPathInfo: Array<TopPathInfo> = updateTopPathInfo([], '文件类型', '')
aboutToAppear() {
LogInfo(this.TAG, 'aboutToAppear')
if (globalThis.debugMode) {
@@ -171,103 +167,103 @@ struct Index {
TopBarArea()
Column() {
Scroll() {
Column() {
Row() {
List() {
ForEach(this.topPathInfo, (item: TopPathInfo) => {
ListItem() {
Row() {
if (item.name != '文件类型') {
Image($r("app.media.ic_public_right"))
.width(12 * 2)
.height(24 * 2)
.margin({
left: 4 * 2,
right: 4 * 2
})
}
Text(item.name)
// Scroll() {
Column() {
Row() {
List() {
ForEach(this.topPathInfo, (item: TopPathInfo) => {
ListItem() {
Row() {
if (item.name != '文件类型') {
Image($r("app.media.ic_public_right"))
.width(12 * 2)
.height(24 * 2)
.fontColor('#000000')
.fontSize(16 * 2)
.fontWeight(FontWeight.Medium)
.opacity(item.opacity)
.onClick(() => {
LogInfo(this.TAG, item.name + ' onClick')
if (item.name == '文件类型') {
updateTopPathInfo([], '文件类型', '')
this.mMenuLevel = menuLevel.MENU_FIRST_LEVEL_BY_TYPE
this.mType = ''
} else if (this.mMenuLevel == menuLevel.MENU_THIRD_LEVEL_HAS_DETAIL) {
this.mCurrentPath = item.path
LogInfo(this.TAG, 'item.path' + item.path)
let topPathInfo: Array<TopPathInfo> = AppStorage.Get('topPathInfo')
let index: number = topPathInfo.indexOf(item)
if (index != -1) {
var deleteNum = topPathInfo.length - index + 1
topPathInfo.splice(index + 1, deleteNum)
topPathInfo[topPathInfo.length - 1].opacity = 1
AppStorage.Set('topPathInfo', topPathInfo)
}
} else if (this.mMenuLevel == menuLevel.MENU_THIRD_LEVEL_HAS_PIC) {
this.mMenuLevel = menuLevel.MENU_SECOND_LEVEL_BY_FOLD
this.mType = changeStringToType(item.name)
LogInfo(this.TAG, 'item.path 2 ' + item.path)
this.mCurrentPath = item.path
}
.margin({
left: 4 * 2,
right: 4 * 2
})
}
}
}, item => item.name.toString())
}
.listDirection(Axis.Horizontal)
}
.alignItems(VerticalAlign.Center)
.width('100%')
.height(48 * 2)
.margin({ left: 24 * 2, top: 4 * 2 })
.padding({ top: 13 * 2, bottom: 13 * 2 })
Row() {
if (this.mMenuLevel == menuLevel.MENU_FIRST_LEVEL_BY_TYPE) {
FirstLevelByType({
mFileList: this.mFirstMenuData,
mType: $mType,
mMenuLevel: $mMenuLevel,
mCurrentPath: $mCurrentPath,
mWorker: this.mWorker,
})
} else if (this.mMenuLevel == menuLevel.MENU_SECOND_LEVEL_BY_FOLD) {
SecondLevelByFold({
mType: $mType,
mMenuLevel: $mMenuLevel,
mCurrentPath: $mCurrentPath,
mWorker: this.mWorker,
mFileList: $mSecondMenuData
})
} else if (this.mMenuLevel == menuLevel.MENU_THIRD_LEVEL_HAS_PIC) {
ThirdLevelHasPic({
mType: $mType,
mMenuLevel: $mMenuLevel,
mCurrentPath: $mCurrentPath,
mWorker: this.mWorker,
mFileList: $mThirdMenuPicData
})
} else if (this.mMenuLevel == menuLevel.MENU_THIRD_LEVEL_HAS_DETAIL) {
ThirdLevelHasDetail({
mType: $mType,
mMenuLevel: $mMenuLevel,
mCurrentPath: $mCurrentPath,
mWorker: this.mWorker,
mFileInfo: $mThirdMenuDetailData
})
}
Text(item.name)
.height(24 * 2)
.fontColor('#000000')
.fontSize(16 * 2)
.fontWeight(FontWeight.Medium)
.opacity(item.opacity)
.onClick(() => {
LogInfo(this.TAG, item.name + ' onClick')
if (item.name == '文件类型') {
updateTopPathInfo([], '文件类型', '')
this.mMenuLevel = menuLevel.MENU_FIRST_LEVEL_BY_TYPE
this.mType = ''
} else if (this.mMenuLevel == menuLevel.MENU_THIRD_LEVEL_HAS_DETAIL) {
this.mCurrentPath = item.path
LogInfo(this.TAG, 'item.path' + item.path)
let topPathInfo: Array<TopPathInfo> = AppStorage.Get('topPathInfo')
let index: number = topPathInfo.indexOf(item)
if (index != -1) {
var deleteNum = topPathInfo.length - index + 1
topPathInfo.splice(index + 1, deleteNum)
topPathInfo[topPathInfo.length - 1].opacity = 1
AppStorage.Set('topPathInfo', topPathInfo)
}
} else if (this.mMenuLevel == menuLevel.MENU_THIRD_LEVEL_HAS_PIC) {
this.mMenuLevel = menuLevel.MENU_SECOND_LEVEL_BY_FOLD
this.mType = changeStringToType(item.name)
LogInfo(this.TAG, 'item.path 2 ' + item.path)
this.mCurrentPath = item.path
}
})
}
}
}, item => item.name.toString())
}
.listDirection(Axis.Horizontal)
}
.alignItems(VerticalAlign.Center)
.width('100%')
.height(48 * 2)
.margin({ left: 24 * 2, top: 4 * 2 })
.padding({ top: 13 * 2, bottom: 13 * 2 })
Row() {
if (this.mMenuLevel == menuLevel.MENU_FIRST_LEVEL_BY_TYPE) {
FirstLevelByType({
mFileList: this.mFirstMenuData,
mType: $mType,
mMenuLevel: $mMenuLevel,
mCurrentPath: $mCurrentPath,
mWorker: this.mWorker,
})
} else if (this.mMenuLevel == menuLevel.MENU_SECOND_LEVEL_BY_FOLD) {
SecondLevelByFold({
mType: $mType,
mMenuLevel: $mMenuLevel,
mCurrentPath: $mCurrentPath,
mWorker: this.mWorker,
mFileList: $mSecondMenuData
})
} else if (this.mMenuLevel == menuLevel.MENU_THIRD_LEVEL_HAS_PIC) {
ThirdLevelHasPic({
mType: $mType,
mMenuLevel: $mMenuLevel,
mCurrentPath: $mCurrentPath,
mWorker: this.mWorker,
mFileList: $mThirdMenuPicData
})
} else if (this.mMenuLevel == menuLevel.MENU_THIRD_LEVEL_HAS_DETAIL) {
ThirdLevelHasDetail({
mType: $mType,
mMenuLevel: $mMenuLevel,
mCurrentPath: $mCurrentPath,
mWorker: this.mWorker,
mFileInfo: $mThirdMenuDetailData
})
}
}
.alignItems(HorizontalAlign.Start)
}
.alignItems(HorizontalAlign.Start)
// }
}
.height(globalThis.mainDialogHeight - (48 * 2))
@@ -287,7 +283,6 @@ struct Index {
@Component
struct TopBarArea {
build() {
Row() {
Text('文件类型')
@@ -296,7 +291,7 @@ struct TopBarArea {
.fontSize(24 * 2)
.fontColor('#182431')
}
.height(56 * 2)
.height(56 * 2)
.width('100%')
.border({ radius: '24px' })
.margin({ left: 24 * 2 })
@@ -383,7 +378,7 @@ struct BottomBar {
.textAlign(TextAlign.Center)
}
.backgroundColor(this.choseFiles.length != 0 ? '#E5E8EA' : '#ECEEF0')
.stateEffect(this.choseFiles.length != 0 )
.stateEffect(this.choseFiles.length != 0)
.margin({ left: 12 * 2 })
.height(40 * 2)
.width(150 * 2)
@@ -0,0 +1,27 @@
{
"version-name": "2.0.0",
"version-code": 2,
"app-distribution-type": "os_integration",
"uuid": "5027b99e-5f9e-465d-9508-a9e0134ffe18",
"validity": {
"not-before": 1594865258,
"not-after": 1689473258
},
"type": "release",
"bundle-info": {
"developer-id": "OpenHarmony",
"distribution-certificate": "-----BEGIN CERTIFICATE-----\nMIICRDCCAcmgAwIBAgIED+E4izAMBggqhkjOPQQDAwUAMGgxCzAJBgNVBAYTAkNO\nMRQwEgYDVQQKEwtPcGVuSGFybW9ueTEZMBcGA1UECxMQT3Blbkhhcm1vbnkgVGVh\nbTEoMCYGA1UEAxMfT3Blbkhhcm1vbnkgQXBwbGljYXRpb24gUm9vdCBDQTAeFw0y\nMTAyMDIxMjE0MThaFw00OTEyMzExMjE0MThaMGgxCzAJBgNVBAYTAkNOMRQwEgYD\nVQQKEwtPcGVuSGFybW9ueTEZMBcGA1UECxMQT3Blbkhhcm1vbnkgVGVhbTEoMCYG\nA1UEAxMfT3Blbkhhcm1vbnkgQXBwbGljYXRpb24gUm9vdCBDQTB2MBAGByqGSM49\nAgEGBSuBBAAiA2IABE023XmRaw2DnO8NSsb+KG/uY0FtS3u5LQucdr3qWVnRW5ui\nQIL6ttNZBEeLTUeYcJZCpayg9Llf+1SmDA7dY4iP2EcRo4UN3rilovtfFfsmH4ty\n3SApHVFzWUl+NwdH8KNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC\nAQYwHQYDVR0OBBYEFBc6EKGrGXzlAE+s0Zgnsphadw7NMAwGCCqGSM49BAMDBQAD\nZwAwZAIwd1p3JzHN93eoPped1li0j64npgqNzwy4OrkehYAqNXpcpaEcLZ7UxW8E\nI2lZJ3SbAjAkqySHb12sIwdSFKSN9KCMMEo/eUT5dUXlcKR2nZz0MJdxT5F51qcX\n1CumzkcYhgU=\n-----END CERTIFICATE-----\n",
"bundle-name": "com.ohos.filepicker",
"apl": "normal",
"app-feature": "hos_system_app"
},
"acls": {
"allowed-acls": [
"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED"
]
},
"permissions": {
"restricted-permissions": []
},
"issuer": "pki_internal"
}
-29
View File
@@ -1,29 +0,0 @@
-----BEGIN CERTIFICATE-----
MIICOjCCAb2gAwIBAgIESerZTzAMBggqhkjOPQQDAwUAMGMxCzAJBgNVBAYTAkNO
MRQwEgYDVQQKEwtPcGVuSGFybW9ueTEZMBcGA1UECxMQT3Blbkhhcm1vbnkgVGVh
bTEjMCEGA1UEAxMaT3Blbkhhcm1vbnkgQXBwbGljYXRpb24gQ0EwHhcNMjIwMjE1
MDkzMTQ1WhcNMzIwMjEzMDkzMTQ1WjBuMQswCQYDVQQGEwJDTjERMA8GA1UECBMI
RG9uZ0d1YW4xETAPBgNVBAc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UdIwQYMBaAFBc6EKGrGXzlAE+s0Zgnsphadw7NMA8G
A1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBTbhrciFtUL
oUu33SV7ufEFfaItRzAMBggqhkjOPQQDAwUAA2gAMGUCMG3cXjiDmXTvf7D4Omhf
qcc2nuO+EMfWE+N9ZhBP5UhV34mAGWi3SfLU6rcV0urWEQIxAMYIb3epOnKhUrcm
Lfu1WKzFlpYQwmw73RaCHP2I3k6NcuWOYeNwWXSNZ8o0nzvaLg==
-----END CERTIFICATE-----
-10
View File
@@ -1,10 +0,0 @@
-----BEGIN NEW CERTIFICATE REQUEST-----
MIIBXDCCAQACAQAwbjELMAkGA1UEBhMCQ04xETAPBgNVBAgTCERvbmdHdWFuMREw
DwYDVQQHEwhTaGVuWmhlbjEQMA4GA1UEChMHSURFVGVhbTEPMA0GA1UECxMGSHVh
d2VpMRYwFAYDVQQDEw1teUFwcGxpY2F0aW9uMFkwEwYHKoZIzj0CAQYIKoZIzj0D
AQcDQgAEHdXlIIouSY4H1Fb9o9I2XKVp95V1vZpNzXsNUu5T2+LzHK8dewjlWSM7
5LnhahY2kZMnp+znrWGCklpW2UeFN6AwMC4GCSqGSIb3DQEJDjEhMB8wHQYDVR0O
BBYEFPJMeP4RMoushb9kZ902jTWktK/wMAwGCCqGSM49BAMCBQADSAAwRQIhAKOX
Lp3oAng+oLpF2Xm1fmTvI0Bu+8qjE7VWCCtPvhmxAiBx0jiN6ZKUE1tauwesg1fm
z4rBhCnhtUyBb5yfo4VZ/w==
-----END NEW CERTIFICATE REQUEST-----
Binary file not shown.
@@ -1 +0,0 @@
^Lテ。・ゥcウvヨワ#b
@@ -1 +0,0 @@
[´T%§*Ç™2S­¸•
@@ -1 +0,0 @@
^M阤#;!撝
@@ -1 +0,0 @@
M~^$zb8