Skip to content

Commit fbd1e4c

Browse files
committed
[tinker] Fixed problem for isArkHotRuning() always returns false
1 parent 338e7b2 commit fbd1e4c

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

tinker-android/tinker-android-loader/src/main/java/com/tencent/tinker/loader/shareutil/SharePatchFileUtil.java

+1
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,7 @@ public static String getMD5(final File file) {
451451
String md5 = getMD5(fin);
452452
return md5;
453453
} catch (Exception e) {
454+
Log.e(TAG, e.getMessage());
454455
return null;
455456
} finally {
456457
closeQuietly(fin);

tinker-android/tinker-android-loader/src/main/java/com/tencent/tinker/loader/shareutil/ShareTinkerInternals.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public class ShareTinkerInternals {
5050
private static final String PATCH_PROCESS_NAME = ":patch";
5151

5252
private static Boolean isPatchProcess = null;
53-
private static Boolean isARKHotRunning = false;
53+
private static Boolean isARKHotRunning = null;
5454
/**
5555
* or you may just hardcode them in your app
5656
*/

tinker-build/tinker-patch-cli/tool_output/tinker_config.xml

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?xml version="1.0" encoding="UTF-8"?>
1+
<?xml version="1.0" encoding="UTF-8"?>
22
<!--command version is not recommended, you must add the tinker proguard file and multiDex keep file yourself-->
33
<!--further, you must put TINKER_ID in your your AndroidManifest.xml such as <meta-data android:name="TINKER_ID" android:value="b168b32"/>-->
44
<!--and you'd better use applymapping to build the patch apk-->
@@ -24,7 +24,8 @@
2424

2525
<!--if you don't set sevenZip path, we just use 7za to try-->
2626
<sevenZipPath value="/usr/local/bin/7za"/>
27-
27+
<!-- demo for windows-->
28+
<!-- <sevenZipPath value="C:\Program Files (x86)\7-Zip\7z.exe"/> -->
2829
<!--Whether tinker should treat the base apk as the one being protected by app-->
2930
<!--protection tools.-->
3031
<!--If this attribute is true, the generated patch package will contain a-->
@@ -69,8 +70,8 @@
6970
<pattern value="lib/*/*.so"/>
7071
</issue>
7172

72-
<issue id="ark">
73-
<path value="ark"/>
73+
<issue id="arkHot">
74+
<path value="arkHot"/>
7475
<name value="patch.apk"/>
7576
</issue>
7677

@@ -115,7 +116,7 @@
115116
<!--sign, if you want to sign the apk, and if you want to use 7zip, you must fill in the following data-->
116117
<issue id="sign">
117118
<!--the signature file path, in window use \, in linux use /, and the default path is the running location-->
118-
<path value="tool_output/release.keystore"/>
119+
<path value="release.keystore"/>
119120
<!--storepass-->
120121
<storepass value="testres"/>
121122
<!--keypass-->

tinker-sample-android/app/src/main/java/tinker/sample/android/app/MainActivity.java

+2
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ public class MainActivity extends AppCompatActivity {
5353
protected void onCreate(Bundle savedInstanceState) {
5454
super.onCreate(savedInstanceState);
5555
setContentView(R.layout.activity_main);
56+
boolean isARKHotRunning = ShareTinkerInternals.isArkHotRuning();
57+
Log.e(TAG, "ARK HOT Running status = " + isARKHotRunning);
5658
Log.e(TAG, "i am on onCreate classloader:" + MainActivity.class.getClassLoader().toString());
5759
//test resource change
5860
Log.e(TAG, "i am on onCreate string:" + getResources().getString(R.string.test_resource));

0 commit comments

Comments
 (0)